# # 第一阶段：构建 geth
# FROM ethereum/client-go:stable AS builder

# # 设置工作目录
# WORKDIR /seed
 
# # 复制所需文件到镜像中
# COPY password.sec /seed/
# COPY fast-dev.json /seed/
# COPY standard-dev.json /seed/
# COPY mainnet-dev.json /seed/
# COPY keystore/UTC--2019-04-06T21-13-27.692266000Z--8a91dc2d28b689474298d91899f0c1baf62cb85b /seed/keystore/
# COPY geth-entry.sh /bin/
# CMD ["which geth"] 
# # 设置入口点，启动 geth-entry.sh
# ENTRYPOINT [ "sh", "/bin/geth-entry.sh" ]

# # 第二阶段：使用轻量级 ubuntu 镜像
FROM ubuntu:20.04

# 设置工作目录
WORKDIR /seed
# 从第一阶段复制 geth 及其它文件
# COPY --from=builder /usr/local/bin/geth /usr/local/bin/


# 安装必要的工具
# RUN apt-get update && apt-get install -y curl tar

# 下载 Geth 文件并解压到 /usr/local/bin 并命名为 geth
# RUN curl -SL https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.13.4-3f907d6a.tar.gz | tar -xzC /usr/local/bin --strip=1 \
    # && mv /usr/local/bin/geth /usr/local/bin/geth


COPY geth   /usr/local/bin/
COPY geth-entry.sh /seed/
COPY password.sec /seed/
COPY fast-dev.json /seed/
COPY standard-dev.json /seed/
COPY mainnet-dev.json /seed/
COPY keystore/UTC--2019-04-06T21-13-27.692266000Z--8a91dc2d28b689474298d91899f0c1baf62cb85b /seed/keystore/

# 暴露 geth 使用的端口
EXPOSE 8545 8546 30303 30303/udp

RUN  cd /seed
RUN  chmod +x geth-entry.sh

CMD ["./geth-entry.sh"]

# 设置入口点，启动 geth-entry.sh
# ENTRYPOINT [ "sh", "/bin/geth-entry.sh" ]
